0%

centOS6上实现git clone

git clone一直出错,最初以为是代理问题,但对git一通代理设置之后并没有什么用

报错如下

1
2
3
4
5
6
7
8
$git clone https://github.com/***.git
fatal: unable to access 'https://github.com/***.git/': SSL connect error
$ GIT_CURL_VERBOSE=1 git clone https://github.com/***.git
.....
* NSS error -12190
* Expire cleared
* Closing connection #0
fatal: unable to access 'https://github.com/***.git/': SSL connect error

查看系统版本,centos6.6

网上教程是要更新~$ yum update -y nss curl,看起来一步搞定,但是我没有这个条件,服务器是通过内网上网的,所以只能手动安装,并且 更新curl的功能就好了

1、安装repo

rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/city-fan.org-release-2-1.rhel6.noarch.rpm

2、查看该 repo 包含的 curl 版本

yum –showduplicates list curl –disablerepo=”*” –enablerepo=”city*”

3、修改该repo的enable为1

vi /etc/yum.repos.d/city-fan.org.repo

如下所示

[city-fan.org]

name=city-fan.org repository for Red Hat Enterprise Linux (and clones) $releasever ($basearch)

#baseurl=http://mirror.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch

mirrorlist=http://mirror.city-fan.org/ftp/contrib/yum-repo/mirrorlist-rhel$releasever

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org

4、安装最新的curl

1
2
3
> yum --showduplicates list curl --disablerepo="*"  --enablerepo="city*"
> yum install "curl-7.65.0-6.0.cf.rhel6.x86_64" --disablerepo="*" --enablerepo="city*"
>

yum install curl

5、如果提示缺少依赖 libnghttp2.so.14()(64bit)

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/Packages/l/libnghttp2-1.6.0-1.el6.1.x86_64.rpm

下载不了就直接wget吧,然后再安装

然后重复第4步即可

6、查看curl版本

curl -V

curl 7.60.0 (x86_64-conda_cos6-linux-gnu) libcurl/7.60.0 OpenSSL/1.0.2o zlib/1.2.11
Release-Date: 2018-05-16
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy